package net.wofly.sale.order.service.impl;

import java.util.List;

import javax.transaction.Transactional;

import net.wofly.sale.order.domain.OrderType;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Service;

import net.wofly.sale.order.repository.RoleOrderTypeRepository;
import net.wofly.sale.order.domain.RoleOrderType;
import net.wofly.sale.order.service.IRoleOrderTypeService;

@Service("iRoleOrderTypeService")
@Transactional
public class RoleOrderTypeServiceImpl implements IRoleOrderTypeService {

	@Autowired
	RoleOrderTypeRepository roleOrderTypeRepository;

	@Override
	public RoleOrderType save(RoleOrderType entity) {
		return roleOrderTypeRepository.save(entity);
	}

	@Override
	public void delete(RoleOrderType entity) {
		roleOrderTypeRepository.delete(entity);
	}

	@Override
	public void delete(String key) {
		roleOrderTypeRepository.delete(key);
	}

	@Override
	public RoleOrderType findOne(String key) {
		return roleOrderTypeRepository.findOne(key);
	}

	@Override
	public List<RoleOrderType> save(List<RoleOrderType> entityList) {
		return (List<RoleOrderType>) roleOrderTypeRepository.save(entityList);
	}
	
	@Override
	public List<OrderType> findByRoleID(String roleID) {
		return roleOrderTypeRepository.findByRoleID(roleID);
	}
	
	@Override
	public List<OrderType> findByRoleIDAndStatus(String roleID,Integer status) {
		return roleOrderTypeRepository.findByRoleIDAndStatus(roleID,status);
	}
	
}
